<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello MUI</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--标准mui.css-->
		<link rel="stylesheet" href="css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="css/app.css" />
		<style>
			h5 {
				margin: 5px 7px;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">审核拒绝</h1>
			<button id="savebkr" type="button" class="mui-left mui-btn mui-btn-link mui-btn-nav mui-pull-right">
					保存
				</button>
		</header>
		<div class="mui-content">
			<div class="mui-content-padded" style="margin: 5px;">

				<div class="mui-input-row" style="margin: 10px 5px;">
					<textarea id="bz" rows="5" placeholder="请输入备注" style="margin-bottom: 0;"></textarea>
				</div>
				<script src="js/mui.min.js"></script>
				<script src="js/jquery.min.js"></script>
				<script src="js/config.js"></script>
				<script type="text/javascript">
					mui.init({
						swipeBack: true //启用右滑关闭功能
					});
					mui.plusReady(function() {
						var self = plus.webview.currentWebview();
						//					var myid = self.mainid;
						var shld = localStorage.getItem("shld");
						var adminuser = JSON.parse(localStorage.adminuser);
						var obj = null;

						$(function() {
							if(typeof(myid) != 'undefined') {
								$.get(dataDomain + "/dc/info/" + myid, function(req) {
									obj = req;

									$("#bz").val(req.remark);
									$("#idstr").val(req.idstr);
									setids(req.alarmIds);
								});
							}
							$("#savebkr").on("tap", function() {

								var bz = $("#bz").val();

								var idstr = localStorage.getItem("idstr");

								if(bz == '') {
									mui.alert("请输入备注");
									return false;
								}

								$.ajax({
									type: "POST",
									url: dataDomain + "/dc/info/unpass",
									data: {
										ids: idstr,
										remark: bz
									},
									async: true,
									success: function(req) {
										if(req.status == 'ok') {

											mui.toast("提交成功");
											setTimeout(function() {
												plus.webview.currentWebview().close();
											}, 1000);
										} else {
											mui.toast("提交失败，请稍候再试");
										}
									}
								});

							});
						});
					});
				</script>
	</body>

</html>